package org.jeecg.report.enums;

import lombok.Getter;

@Getter
public enum SpcD2Enum {
    D2_1(1.128, 1),
    D2_2(1.128, 2),
    D2_3(1.693, 3),
    D2_4(2.059, 4),
    D2_5(2.326, 5),
    D2_6(2.534, 6),
    D2_7(2.704, 7),
    D2_8(2.847, 8),
    D2_9(2.970, 9),
    D2_10(3.078, 10),
    D2_11(3.173, 11),
    D2_12(3.258, 12),
    D2_13(3.336, 13),
    D2_14(3.407, 14),
    D2_15(3.472, 15),
    D2_16(3.532, 16),
    D2_17(3.588, 17),
    D2_18(3.640, 18),
    D2_19(3.689, 19),
    D2_20(3.735, 20);
    // 成员变量
    private final Double constant;
    private final int num;

    // 构造方法
    SpcD2Enum(Double constant, int num) {
        this.constant = constant;
        this.num = num;
    }

    // 普通方法
    public static Double getConstant(int num) {
        for (SpcD2Enum c : SpcD2Enum.values()) {
            if (c.getNum() == num) {
                return c.constant;
            }
        }
        return null;
    }
}
